import {request} from './request';

export function register(data) {
    return request ({
        url:'/api/auth/register',
        method:'post',
        data:data
    })
}

export function login(data) {
    return request ({
        url:'/api/auth/login',
        method:'post',
        data
    })
}

export function logout(data) {
    return request ({
        url:'/api/auth/logout',
        method:'post',
    })
}

export function getuser() {
    return request ({
        url:'/api/user',
        method:'get',
    })
}

//更新用户头像
export function changepic(data) {
    return request ({
        url:'/api/user/avatar',
        method:'post',    //接口写成了PATCH 大坑
        data
    })
}

//更新用户名
export function changename(data) {
    return request ({
        url:'/api/user',
        method:'put',
        data
    })
}